
import matplotlib.pyplot as plt
import numpy as np
from numpy.random import randn

def draw(data):
	# a = np.loadtxt('/Users/mac/Desktop/datas.txt')
	y1= data #[10,13,5,40,30,60,70,12,55,25] 
	x1=range(0,len(data)) 
	plt.plot(x1,y1,label='Frist line',linewidth=3,color='r',marker='o', 
	markerfacecolor='blue',markersize=12) 
	plt.xlabel('Plot Number') 
	plt.ylabel('Important var') 
	plt.title('Interesting Graph\nCheck it out') 
	plt.legend() 
	plt.show()

def draw_1(data):
	fig = plt.figure()
	ax = fig.add_subplot(2,2,1)
	ax.hist(data, 20, histtype='bar',facecolor='yellowgreen',alpha=0.75)
	plt.show()

def drawpic():
	fig = plt.figure()
	ax1 = fig.add_subplot(2,2,1)
	ax2 = fig.add_subplot(2,2,2)
	ax3 = fig.add_subplot(2,2,3)
	plt.plot(randn(50).cumsum(), 'k--')
	ax1.hist(randn(100), bins=20, color = 'k', alpha = 0.3)
	ax2.scatter(np.arange(30), np.arange(30) + 3 * randn(30))

def drawLine(data):
	N=len(data)
	y=data
	index = np.arange(N)
	p1=plt.bar(index,y,width=0.5,color='b')
	plt.show()
	print 


def getdata():
	f = open('/Users/mac/Desktop/datas.txt')
	li = f.readlines()
	datas = []
	for line in li:
		strs = line.split('	')
		datas.append(float(strs[1]))
	return datas

#drawpic()
#draw()
datas = getdata()
#draw(datas)
#draw_1(datas)
drawLine(datas)


















